import { createBrowserRouter } from "react-router-dom";
// 3.完成项目路由表的规划与构建，实现路由的准确渲染
export const erji = [
  {
    path: "/one",
    lazy: async () => {
      const { default: One } = await import("../prares/One/Index");
      return {
        element: <One />,
      };
    },
    title: "第一个页面",
  },
  {
    path: "/two",
    lazy: async () => {
      const { default: Two } = await import("../prares/Two/Index");
      return {
        element: <Two />,
      };
    },
    title: "第二个页面",
  },
  {
    path: "/thress",
    lazy: async () => {
      const { default: Thress } = await import("../prares/Thress/Index");
      return {
        element: <Thress />,
      };
    },
    title: "第三个页面",
  },
  {
    path: "/frou",
    lazy: async () => {
      const { default: Frou } = await import("../prares/Frou/Index");
      return {
        element: <Frou />,
      };
    },
    title: "第四个页面",
  },
  {
    path: "/five",
    lazy: async () => {
      const { default: Five } = await import("../prares/Five/Index");
      return {
        element: <Five />,
      };
    },
    title: "第五个页面",
  },
  {
    path: "/sixe",
    lazy: async () => {
      const { default: Sixe } = await import("../prares/Sixe/Index");
      return {
        element: <Sixe />,
      };
    },
    title: "第六个页面",
  },
  {
    path: "/server",
    lazy: async () => {
      const { default: Server } = await import("../prares/Server/Index");
      return {
        element: <Server />,
      };
    },
    title: "第七个页面",
  },
];
const router = createBrowserRouter([
  {
    path: "/",
    lazy: async () => {
      const { default: Home } = await import("../prares/Home/Index");
      return {
        element: <Home />,
      };
    },
    children: erji,
  },
]);

export default router;
